$(document).ready(function(){

ccxQQ();
ccxMES();


});
function ccxQQ()
{
var qqmes=$("#qqmes");
var ccxmesbox=$("#ccxmes");
//ie6
if  ($.browser.msie && ($.browser.version == "6.0") && !$.support.style) {
var pdiv=$("#KFqq");
var wpost=150;//上的距离
pdiv.css({position:"absolute"});
$(window).scroll( function() {var postop=$(window);	pdiv.css({top:""+(postop.scrollTop()+wpost)+"px"});});
}
//正常
var qqdiv=$("#KFqq");
var qqbut=$(".KFbottom");
var qqlis=$(".KFlist");
qqbut.toggle(function(){
var ss=(qqbut.width()+qqlis.width());
qqdiv.animate({width:""+ss+"px"},500);	
},function(){qqdiv.animate({width:""+qqbut.width()+"px"},300);});
setInterval(function(){qqdiv.animate({width:""+qqbut.width()+"px"},300);},10000);
qqmes.click(function(){
	if  ($.browser.msie && ($.browser.version == "6.0") && !$.support.style) {
	}else
	{
	ccxmesbox.animate({height:"200px"},500);	
	return false;
	}
});
}


function ccxMES()
{
var qqmes=$("#ccxmes");
//ie6
if($.browser.msie && ($.browser.version == "6.0") && !$.support.style) {
qqmes.css({position:"absolute"});
$(window).scroll( function() {var postop=$(window);	qqmes.css({top:""+(postop.scrollTop()+($(window).height()-qqmes.height()))+"px"});});
}
//正常
//关闭事件
var ccxmesclose=$("#ccxmesclose,#ccxquit");
ccxmesclose.hover(function(){$(this).attr('title','关闭');$(this).addClass('ccxmesclosein');},function(){$(this).removeClass('ccxmesclosein');});
ccxmesclose.click(function(){qqmes.animate({height:"0px"},500);});
//发送
var ccxmesbox=$("#ccxmesbox");
var ccxemail=$("#ccxemail");
var ccxcontent=$("#ccxcontent");
var ccxbutton=$("#ccxbutton");
ccxbutton.bind('click',function(){
//对电子邮件的验证
var myreg = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
if(ccxemail.val()!=""){
if(!myreg.test(ccxemail.val())){
ccxemail.css({border:"1px solid #f00"});
ccxemail.focus();
return false;}}else{ccxemail.css({border:"1px solid #f00"});ccxemail.focus();return false;}

ccxmesbox.append('<div id="loadings">loadings</div>');

alert(ccxemail.val());
alert(ccxcontent.val());
$.post("/Contact/tomail.aspx", { nsemail: ccxemail.val(), nscontent: ccxcontent.val() }, function (d) {
            if (d.uid == 0) {//发送成功
                alert(d.msg);
				return false;
				
            }
            else {//发送失败
                alert(d.msg);
            }
        }, "json");
loadings();
});
}
function loadings()
{
	$(document).ajaxStart(function () { 
$("#loadings").show();
}).ajaxStop(function () { 
$("#loadings").fadeOut('slow');
});
}
